#include <bits/stdc++.h>
using namespace std;

class Solution
{
public:
    int n;
    int ans = 0;
    int t;
    void dfs(int x, vector<int>& nums, int now_Sum)
    {
        if (x == n)
        {
            if (now_Sum == t)
            {
                ans++;
            }
            return ;
        }
        dfs(x + 1, nums, now_Sum + nums[x] );
        dfs(x + 1, nums, now_Sum - nums[x] );
    }
    int findTargetSumWays(vector<int>& nums, int target)
    {
        n = nums.size();
        t = target;
        dfs(0 , nums, 0);
        return ans;
    }
};



